Data verification method, device, computer equipment and storage medium

Through hash storage and indexing technology, data is directly queried and compared, and the problem of slow data reconciliation speed in the existing technology is solved, achieving efficient data reconciliation.

CN112433988BActive Publication Date: 2024-11-22CHINA CONSTRUCTION BANK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011380816.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2024-11-22
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

In the existing data verification method, the data of the two files need to be sorted, resulting in large system resources consumption and slow data verification speed.

Method used

By using hash storage, we determine the key data of each piece of data, establish a hash index, omit the sorting steps, and directly query and compare the data to obtain the checking results.

Benefits of technology

It improves the efficiency of data verification, reduces system resource consumption, and shortens verification time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112433988B_ABST
    Figure CN112433988B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data verification method, device, computer equipment and storage medium. The method includes: obtaining multiple first data of a first file, and determining the corresponding first key data for each first data; storing each first data in the first file in a hash storage manner according to each first key data; obtaining multiple second data of a second file, and determining the corresponding second key data for each second data, wherein the determination method of the first key data is the same as the determination method of the second key data; respectively querying the first data matching each second key data, and the first key data corresponding to the first data matches the second key data; respectively comparing the second data corresponding to each second key data with the matching first data, and determining the verification result between the first file and the second file. The embodiment of the present invention can improve the efficiency of data verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing, and in particular to a data verification method, device, computer equipment and storage medium. Background Art

[0002] Because the records in the account flow detail file are out of order, the reconciliation first requires matching the records in the two files one by one and then comparing them. In the original data verification method, the one-to-one correspondence of the records is achieved by sorting the two files separately and then reading them in order.

[0003] Currently, sorting is an essential step in the original data verification method. However, this step will consume a lot of system resources, resulting in a slow process of the entire reconciliation. Summary of the invention

[0004] The embodiments of the present invention provide a data checking method, device, computer equipment and storage medium, which can improve the data checking efficiency.

[0005] In a first aspect, an embodiment of the present invention provides a data verification method, comprising:

[0006] Acquire multiple pieces of first data from the first file, and determine corresponding first key data for each piece of first data;

[0007] According to each of the first key data, each of the first data in the first file is stored in a hash storage manner;

[0008] Acquire multiple pieces of second data from the second file, and determine corresponding second key data for each piece of second data, wherein the first key data is determined in the same manner as the second key data;

[0009] respectively querying the first data matching each of the second key data, and the first key data corresponding to the first data matches the second key data;

[0010] The second data corresponding to each of the second key data are respectively compared with the matching first data to determine the verification result between the first file and the second file.

[0011] In a second aspect, an embodiment of the present invention further provides a data checking device, comprising:

[0012] A first file data acquisition module, used to acquire multiple pieces of first data from a first file, and determine corresponding first key data for each piece of first data;

[0013] A first file data storage module, used for storing each of the first data in the first file in a hash storage manner according to each of the first key data;

[0014] A second file data acquisition module, used to acquire multiple pieces of second data from a second file, and determine corresponding second key data for each piece of second data, wherein the first key data is determined in the same manner as the second key data;

[0015] A key data matching module, used for respectively searching for first data matching each of the second key data, wherein the first key data corresponding to the first data matches the second key data;

[0016] The data checking module is used to compare the second data corresponding to each of the second key data with the matching first data respectively, and determine the checking result between the first file and the second file.

[0017] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the program, a data verification method as described in any one of the embodiments of the present invention is implemented.

[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a data verification method as described in any one of the embodiments of the present invention.

[0019] The embodiment of the present invention determines the corresponding first key data according to the first data in the first file and performs hash storage. When verification is required, it traverses each second data in the second file to determine the second key data corresponding to each second data, and queries the corresponding first data, compares the first data and the second data, and obtains a verification result. This solves the problem in the prior art that the data in the two files must be sorted separately before data verification can be performed, resulting in slow data verification. The step of sorting the data in the files can be omitted, thereby improving the efficiency of data verification in the two files. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flow chart of a data verification method in Embodiment 1 of the present invention;

[0021] Figure 2a is a flow chart of a data verification method in Embodiment 2 of the present invention;

[0022] Figure 2b It is a schematic diagram of the structure of a hash linked list in the second embodiment of the present invention;

[0023] Figure 3 It is a structural schematic diagram of a data checking device in Embodiment 3 of the present invention;

[0024] Figure 4 It is a structural diagram of a computer device in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0026] Embodiment 1

[0027] Figure 1 This is a schematic diagram of a flow chart of a data verification method in Embodiment 1 of the present invention. This embodiment is applicable to the case of verifying data in two files. The method can be executed by a data verification device provided by an embodiment of the present invention. The device can be implemented in software and / or hardware and can generally be integrated into a computer device. Figure 1 As shown, the method of this embodiment specifically includes:

[0028] S110, obtaining multiple pieces of first data from a first file, and determining corresponding first key data for each piece of first data.

[0029] At present, China UnionPay is the Chinese bank card association. Through the UnionPay inter-bank transaction clearing system, banks have achieved interconnection between bank systems, thereby enabling bank cards to be used across banks, regions and borders.

[0030] For an inter-bank transaction, during the transaction, the bank system records a transaction, and the UnionPay system also records a transaction. At the end of the day, the transaction file recorded by the UnionPay system is sent to each bank system for reconciliation and settlement.

[0031] In an embodiment of the present invention, the first file is a data file associated with each subsystem stored in the system, and the second file is a data file stored in the subsystem. The system includes multiple subsystems, and each subsystem performs data transmission in the system. Specifically, the first file is a transaction file associated with a bank system stored in the UnionPay system, and the second file is a transaction file stored in the bank system. The UnionPay system includes multiple bank systems, and each bank system performs data transmission through the UnionPay system.

[0032] The first file may refer to a data file associated with the current subsystem stored in the system, which is used for the current subsystem to check the data file stored in itself. The first file includes a large amount of data. Each piece of data includes multiple fields and attribute values ​​corresponding to each field. The first key data is used to identify a piece of data. Different data correspond to different first key data.

[0033] Optionally, obtaining the multiple first data from the first file includes: receiving a file sent by an external system to obtain the first file; and obtaining the first data from the first file one by one.

[0034] The external system may refer to the aforementioned UnionPay system. The computer device that executes the data verification method provided in the embodiment of the present invention may refer to a bank system in the UnionPay system. The file received from the external system is determined as the first file.

[0035] Optionally, the receiving a file sent by an external system to obtain a first file includes: receiving a file sent by an external system and performing format conversion to form the first file.

[0036] Since the encoding format of the file in the external system is different from that in the bank system, after receiving the file sent by the external system, the file is format-converted in advance, and the file after format conversion is determined as the first file. The advantage of this setting is that the first file can be converted into a file that can be correctly parsed by the bank system, so that data can be accurately read from the first file one by one, thereby improving the accuracy of data verification.

[0037] Optionally, the receiving of files sent by an external system and performing format conversion to form a first file includes: receiving at least one file sent by an external system, wherein each of the files includes files sent in multiple batches and / or files sent by different external subsystems, and the external system includes at least two external subsystems; merging each of the files and performing format conversion to form a first file.

[0038] In fact, the external system can send files in batches, or the external system has at least two external subsystems, which send files separately. Therefore, the received files can be merged in advance, and then the data can be checked after merging. Exemplarily, batch merging is performed for multiple batches of files; for different senders, the files sent by each external subsystem can be merged according to their belonging to the same external system. The advantage of this setting is that the received files can be merged, the data range of the first file can be increased, and the accuracy of data verification can be improved.

[0039] Optionally, determining the corresponding first key data for each piece of first data includes: extracting at least one transaction information from the first data, wherein the transaction information includes: user account, transaction type, transaction amount, transaction time, transaction identifier or associated system identifier; and splicing each of the transaction information to form the first key data corresponding to the data.

[0040] Transaction information is information in the data. Multiple transaction information can be combined to distinguish it from other data. Multiple transaction information is extracted from the data and spliced ​​to form key data.

[0041] Exemplarily, transaction information may include: user account, transaction type, transaction amount, transaction time, transaction identifier or associated system identifier. Among them, the user account may refer to the account used by the user for the transaction. The transaction type corresponds to the transaction processing code, and the transaction processing code can be queried through the external system specification to determine the transaction type. The transaction amount refers to the amount involved in a transaction. The transaction time may refer to the initiation time and completion time of a transaction, etc. The transaction identifier may refer to the system tracking number, which is used to identify a transaction in the external system and the bank system during the transaction processing process, that is, the system tracking number of the transaction in the external system and the system tracking number in the bank system are the same. The associated system identifier may include the acceptance system identifier and the sending system identifier. The acceptance system may refer to an institution that has been approved to access the network and can provide cash withdrawal services for bank ATMs or provide acquiring services for merchants. The sending system may refer to an institution that has been approved to access the network and sends a transaction request or notification message.

[0042] Each transaction information can be represented by a string, and the strings are concatenated to form a key value, which is used as key data. The advantage of this setting is that a piece of data can be accurately identified and distinguished from other pieces of data.

[0043] S120: According to each of the first key data, each of the first data in the first file is stored in a hash storage manner.

[0044] The hash storage method may refer to calculating a hash value using a hash algorithm according to the first key data, locating a set storage location according to the hash value, and storing the data in the storage location. Subsequently, a hash value may be calculated according to the first key data, and the storage location may be located to obtain the data. An index relationship between the first key data and the data is established.

[0045] S130, obtaining multiple pieces of second data from the second file, and determining corresponding second key data for each piece of second data, wherein a method for determining the first key data is the same as a method for determining the second key data.

[0046] The data of the second file is used to be compared with the data of the first file one by one, and the second key data of each piece of data is determined in the same way as the first key data.

[0047] Optionally, obtaining the multiple pieces of data from the second file includes: obtaining a file to be checked from a database as the second file; and obtaining the second data piece by piece from the second file.

[0048] The second file is a locally stored file. The second file may refer to bank system flow records recorded by the bank system. The second data is obtained from the second file one by one, so that the data of the second file can be checked without omission, thereby improving the accuracy of the check.

[0049] Optionally, the respectively querying of the first data matching each of the second key data, wherein the first key data corresponding to the first data matches the second key data, includes: respectively calculating the hash values ​​corresponding to each of the second key data, traversing the hash values ​​corresponding to each of the second key data, and querying the first data matching each of the hash values ​​to determine the first data matching each of the second key data; and comparing the first data matching each of the second key data with the corresponding second data.

[0050] For each second key data, the corresponding hash value is calculated respectively, wherein the hash value calculation method is the same as the hash value calculation method for the first key data. The second key data is traversed, and the first data matching the hash value corresponding to each second key data is searched in the data table pre-stored by hash, and the first data matching the second key data is determined. The first data matching the second key data and the second data corresponding to the second key data actually refer to the same data. By checking these two data, it can be determined whether the transaction records of the UnionPay system and the transaction records corresponding to the bank system are consistent.

[0051] The advantage of such a setting is that the matching first data can be quickly queried based on the second key data, the arrangement operation of the first data and the second data can be omitted, and the data verification efficiency can be improved.

[0052] S140, respectively querying the first data matching each of the second key data, and the first key data corresponding to the first data matches the second key data.

[0053] The second key data is used to query the matching first data by hash positioning. The first data and the second data corresponding to the second key data are mutually verified data. At the same time, the first key data corresponding to the first data matches the second key data, such as being the same.

[0054] In fact, if the first data and the second data are two pieces of data to be checked, the fields included in the first data and the second data should be the same, and the attribute values ​​corresponding to the fields should be the same. At the same time, the first key data extracted from the first data should be the same as the second key data extracted from the second data.

[0055] Thus, the second key data extracted from the second data can be located to the matching first data through the hash value, thereby directly querying the first data that needs to be checked.

[0056] S150: Compare the second data corresponding to each of the second key data with the matching first data respectively to determine the verification result between the first file and the second file.

[0057] The second data corresponding to the second key data is compared with the first data matched by the second key data to obtain a verification result of the second data, wherein the verification result may include a same result and a different result.

[0058] Optionally, the comparing the second data corresponding to each second key data with the matching first data respectively to determine the verification result between the first file and the second file includes: if the verification result obtained by comparing the second data corresponding to the second key data with the matching first data is the same, then storing the second data corresponding to the second key data and the matching first data in the first database; if the verification result obtained by comparing the second data corresponding to the second key data with the matching first data is different, then storing the second data corresponding to the second key data and the matching first data in the second database; when the reconciliation of each second data in the second file with each first data in the first file is completed, the first database and the second database are used as the verification results.

[0059] The same result means that the first data and the corresponding second data are the same. The different results mean that the first data and the corresponding second data are different. The two pieces of data of the same result are stored in the first database, and the two pieces of data of the different results are stored in the second database, and the two databases that have been reconciled are determined as the verification results. The data of the two verification results can be obtained at the same time. The advantage of such a setting is that the coverage of the verification results can be increased, the accuracy of the verification results can be improved, and the data of any verification result can be traced back to improve the fault tolerance and stability of the verification system.

[0060] Optionally, while taking the first database and the second database as verification results, it also includes: forming a difference file based on the data in the second database, and sending it to an adjustment system, so that the adjustment system adjusts the data associated with different results according to the difference file.

[0061] The data in the second database are two pieces of data with different results. The data in the second database are formed into a difference file. The difference file is used to provide to the account adjustment system for account adjustment. Account adjustment can refer to adjusting accounts to achieve expected or specified results. The account adjustment system is used to trace the second data included in the difference file in the bank system and provide the associated account information to the user for account adjustment.

[0062] Optionally, while taking the first database and the second database as verification results, it also includes: forming a data table file according to the data in the first database, so that the user can perform business audit according to the data table file.

[0063] The data table file is used to store vouchers. The data table file can be used as a basis for business review and can be called by the bank system.

[0064] By forming a difference file according to the second database and forming a data table file according to the first database, the data corresponding to the verification result can be accurately processed, the business model can be enriched, and the application scenarios of data verification can be increased.

[0065] In addition, the difference files and data table files can together constitute the full file, which can be transmitted to each subsidiary bank system after clearing to enable the bank system to carry out its own accounting processing.

[0066] The embodiment of the present invention determines the corresponding first key data according to the first data in the first file and performs hash storage. When verification is required, it traverses each second data in the second file to determine the second key data corresponding to each second data, and queries the corresponding first data, compares the first data and the second data, and obtains a verification result. This solves the problem in the prior art that the data in the two files must be sorted separately before data verification can be performed, resulting in slow data verification. The step of sorting the data in the files can be omitted, thereby improving the efficiency of data verification in the two files.

[0067] Embodiment 2

[0068] Figure 2a This is a flow chart of a method for generating front-end and back-end codes in Embodiment 2 of the present invention. This embodiment is specific based on the above embodiment. The method of this embodiment specifically includes:

[0069] S210, obtaining multiple pieces of first data from a first file, and determining corresponding first key data for each piece of first data.

[0070] For a non-exhaustive description of the embodiments of the present invention, reference may be made to the aforementioned embodiments.

[0071] S220: Perform a hash calculation on the first key data to obtain a hash value corresponding to the first key data.

[0072] Optionally, performing hash calculation on the first key data includes: performing hash calculation on the first key data using a BKDR hash algorithm.

[0073] The BKDR hash algorithm is a string algorithm, and its calculation formula is:

[0074]

[0075] Among them, a[n] is the first key data of the nth, s is the seed, and size is the number of elements in the array. In order to reduce collisions, the selection of seed is crucial. There are three options for seed selection: a power of 2, an even number that is not a power of 2, and an odd number greater than 1.

[0076] 1) If Seed is a power of 2, when the string is long, overflow may occur during the calculation process. The central processing unit (CPU) handles the overflow by discarding the highest bit, that is, performing a %2x operation on the coefficient. Since the coefficient is a power of 2, the remainder is 0, so some of the preceding characters will not be included in the calculation of the final result, which can easily lead to collisions.

[0077] 2) If Seed is an even number that is not a power of 2, when overflow is encountered, the remainder result is also 0, which is similarly prone to collision.

[0078] 3) If Seed is an odd number greater than 1, even if an overflow occurs, the modulus of the coefficient will not be 0, so each character can participate in the calculation of the final result, reducing the probability of collision.

[0079] In the embodiment of the present invention, an odd number greater than 1 is selected as the Seed. Meanwhile, because shift and subtraction calculations are relatively fast in CPU operations, a special odd number 2n-1 is usually selected as the coefficient.

[0080] S230, determining a corresponding storage address according to the corresponding hash value, and storing first data corresponding to the first key data in the storage address.

[0081] The hash value can uniquely identify a storage address, and since the first key data can uniquely identify the first data, the calculated hash value can uniquely identify the first data. At the same time, the storage space occupied by the hash value is small, which can reduce storage resource consumption.

[0082] Optionally, determining a corresponding storage address according to the corresponding hash value and storing first data corresponding to the first key data in the storage address includes: storing the first data corresponding to the first key data in a node; determining the hash value corresponding to the first key data as an array subscript; and inserting the node into a linked list corresponding to the array subscript.

[0083] A node can refer to a node in a linked list. A linked list is used to store multiple nodes, and a node is used to store a piece of data. A node can be understood as a storage unit. An array subscript is used to identify a node in a linked list, so that it is easy to query the corresponding node according to the array subscript and obtain the pre-stored data from the node.

[0084] For example, the linked list structure is as follows Figure 2b As shown, array space can be pre-allocated, and the hash value calculated for each first key data corresponding to the first data is used as the array subscript to locate the node in the linked list pointed to by the subscript, store the data in the node, and insert it into the linked list. For the second key data corresponding to each second data, the calculated hash value can be used to query the corresponding node in the linked list, and the array subscript corresponding to the node is the same as the hash value calculated for the second key data.

[0085] The advantage of this setting is that an index relationship between the first key data and the first data is established, so that the second key data can quickly obtain the first data and the second data representing the same data when searching for the matching first data, and the sorting operation to obtain the first data and the second data representing the same data can be omitted, and the two pieces of data to be checked can be quickly determined, thereby improving the checking efficiency. Moreover, through linked list storage, the memory usage size can be controlled, and the size of the static account flow detail file is not limited.

[0086] S240, obtaining multiple pieces of second data from the second file, and determining corresponding second key data for each piece of second data, wherein a method for determining the first key data is the same as a method for determining the second key data.

[0087] S250, respectively querying the first data matching each of the second key data, and the first key data corresponding to the first data matches the second key data.

[0088] Optionally, after the first data is found, the first data may be deleted from the linked list stored in the hash format to release linked list storage resources.

[0089] S260: Compare the second data corresponding to each of the second key data with the matching first data respectively to determine the verification result between the first file and the second file.

[0090] The embodiment of the present invention calculates the hash value of the first key data and establishes a corresponding relationship between the hash value and the storage address, so as to index the first data stored at the storage address according to the hash value. Therefore, when performing data query, the matching first data can be quickly located according to the hash value, and the acquisition speed of the first data matching the second data can be accelerated, thereby improving data verification efficiency.

[0091] Embodiment 3

[0092] Figure 3 Schematic diagram of a data checking device in Embodiment 3 of the present invention. Embodiment 3 is a corresponding device for implementing the data checking method provided in the above embodiments of the present invention, which can be implemented in software and / or hardware and can generally be integrated into a computer device.

[0093] Accordingly, the device of this embodiment may include:

[0094] The first file data acquisition module 310 is used to acquire multiple pieces of first data of the first file, and determine corresponding first key data for each piece of first data;

[0095] A first file data storage module 320, configured to store each of the first data in the first file in a hash storage manner according to each of the first key data;

[0096] The second file data acquisition module 330 is used to acquire multiple pieces of second data of the second file, and determine corresponding second key data for each piece of second data, wherein the first key data is determined in the same manner as the second key data;

[0097] A key data matching module 340, configured to respectively query the first data matching each of the second key data, wherein the first key data corresponding to the first data matches the second key data;

[0098] The data checking module 350 is used to compare the second data corresponding to each of the second key data with the matching first data respectively, and determine the checking result between the first file and the second file.

[0099] The embodiment of the present invention automatically identifies the business verification type according to the business information, obtains the message template according to the business verification type and the business information, and generates a first verification message, thereby automatically generating a verification message, processing the first verification message, obtaining the verification result between the first verification message and the second verification message provided by the business party, and realizing automatic verification of the first verification message, thereby solving the problem of low efficiency caused by manual determination of the business verification type and manual verification in the prior art, realizing automatic verification of business information, reducing the labor cost of business verification, improving the efficiency of business verification, and at the same time improving the accuracy of business verification.

[0100] Furthermore, the first file data storage module 320 is specifically used to: perform hash calculation on the first key data to obtain a hash value corresponding to the first key data; determine a corresponding storage address based on the corresponding hash value, and store the first data corresponding to the first key data in the storage address.

[0101] Furthermore, the first file data storage module 320 is specifically used to: store the first data corresponding to the first key data in a node; determine the hash value corresponding to the first key data as an array index; and insert the node into a linked list corresponding to the array index.

[0102] Furthermore, the key data matching module 340 is specifically used to: respectively calculate the hash values ​​corresponding to each of the second key data, traverse the hash values ​​corresponding to each of the second key data, and query the first data matching each of the hash values ​​to determine the first data matching each of the second key data; compare the first data matching each of the second key data with the corresponding second data.

[0103] Furthermore, the data verification module 350 includes: if the verification result obtained by comparing the second data corresponding to the second key data with the matching first data is the same, the second data corresponding to the second key data and the matching first data are stored in the first database; if the verification result obtained by comparing the second data corresponding to the second key data with the matching first data is different, the second data corresponding to the second key data and the matching first data are stored in the second database; when the reconciliation of each second data in the second file with each first data in the first file is completed, the first database and the second database are used as the verification results.

[0104] Furthermore, the data verification device also includes: an account adjustment module, which is used to form a difference file based on the data in the second database while taking the first database and the second database as verification results, and send it to the account adjustment system, so that the account adjustment system can adjust the data associated with different results according to the difference file.

[0105] Furthermore, the data verification device also includes: a report generation module, which is used to form a data table file based on the data in the first database while taking the first database and the second database as verification results, so that the user can perform business audit based on the data table file.

[0106] Furthermore, the first file data acquisition module 310 is specifically used to: extract at least one transaction information from the first data, wherein the transaction information includes: user account, transaction type, transaction amount, transaction time, transaction identifier or associated system identifier; and splice each of the transaction information to form a first key data corresponding to the first data.

[0107] Furthermore, the first file data acquisition module 310 is specifically used to: receive a file sent by an external system to acquire a first file; and acquire first data from the first file one by one.

[0108] Furthermore, the first file data acquisition module 310 is specifically used to: receive a file sent by an external system, and perform format conversion to form a first file.

[0109] Furthermore, the first file data acquisition module 310 is specifically used to: receive at least one file sent by an external system, wherein each of the files includes files sent in multiple batches and / or files sent by different external subsystems, and the external system includes at least two external subsystems; merge each of the files, and perform format conversion to form a first file.

[0110] Furthermore, the second file data acquisition module 330 is specifically used to: acquire the file to be checked from the database as the second file; and acquire the second data from the second file one by one.

[0111] The above-mentioned device can execute the data verification method provided by the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] Embodiment 4

[0113] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 4 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0114] like Figure 4 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16). The computer device 12 may be a device attached to the bus.

[0115] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0116] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0117] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a compact disk read-only memory (CD-ROM), a digital video disk (DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0118] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0119] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN)) through a network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the computer device 12 through the bus 18. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays (Redundant Arrays of Inexpensive Disks, RAID) systems, tape drives, and data backup storage systems.

[0120] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the data checking method provided by any embodiment of the present invention.

[0121] Embodiment 5

[0122] Embodiment 5 of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method provided in all the embodiments of the invention of the present application is implemented as follows: obtaining multiple first data of a first file, and determining corresponding first key data for each first data; storing each first data in the first file in a hash storage manner according to each first key data; obtaining multiple second data of a second file, and determining corresponding second key data for each second data, wherein the manner of determining the first key data is the same as the manner of determining the second key data; respectively querying the first data matching each second key data, and the first key data corresponding to the first data matches the second key data; respectively comparing the second data corresponding to each second key data with the matching first data to determine the verification result between the first file and the second file.

[0123] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0124] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0125] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0126] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a LAN or WAN, or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A data verification method, characterized in that: include: Acquire multiple pieces of first data from the first file, and determine corresponding first key data for each piece of first data; According to each of the first key data, each of the first data in the first file is stored in a hash storage manner; Acquire multiple pieces of second data from the second file, and determine corresponding second key data for each piece of second data, wherein the first key data is determined in the same manner as the second key data; respectively querying the first data matching each of the second key data, and the first key data corresponding to the first data matches the second key data; respectively comparing the second data corresponding to each of the second key data with the matching first data to determine a verification result between the first file and the second file; The determining, for each piece of first data, the corresponding first key data comprises: extracting at least one transaction information from the first data, wherein the transaction information comprises: a user account, a transaction type, a transaction amount, a transaction time, a transaction identifier or an associated system identifier; and concatenating the transaction information to form the first key data corresponding to the data.

2. The method according to claim 1, characterized in that: The storing each of the first data in the first file in a hash storage manner according to each of the first key data includes: Performing a hash calculation on the first key data to obtain a hash value corresponding to the first key data; Determine a corresponding storage address according to the corresponding hash value, and store first data corresponding to the first key data in the storage address.

3. The method according to claim 2, characterized in that The step of determining a corresponding storage address according to the corresponding hash value, and storing first data corresponding to the first key data in the storage address, comprises: Storing first data corresponding to the first key data in the node; Determine the hash value corresponding to the first key data as an array subscript; Insert the node into the linked list corresponding to the array index.

4. The method according to claim 1, characterized in that: The respectively searching for the first data matching each of the second key data, wherein the first key data corresponding to the first data matches the second key data, comprises: Calculate the hash value corresponding to each of the second key data respectively, Traversing the hash values ​​corresponding to the second key data, and searching for the first data matching the hash values, to determine the first data matching the second key data; The first data matched by each of the second key data is compared with the corresponding second data.

5. The method according to claim 1, characterized in that The step of comparing the second data corresponding to each of the second key data with the matching first data to determine the verification result between the first file and the second file includes: If the second data corresponding to the second key data is compared with the matched first data and the verification result obtained is the same result, the second data corresponding to the second key data and the matched first data are stored in the first database; If the second data corresponding to the second key data is compared with the matched first data and the verification result obtained is different, the second data corresponding to the second key data and the matched first data are stored in the second database; When the reconciliation of each second data in the second file with each first data in the first file is completed, the first database and the second database are used as the reconciliation result.

6. The method according to claim 5, characterized in that While taking the first database and the second database as the verification result, the method further includes: A difference file is formed according to the data in the second database, and is sent to the account adjustment system, so that the account adjustment system performs account adjustment processing on the data associated with different results according to the difference file.

7. The method according to claim 5, characterized in that While taking the first database and the second database as the verification result, the method further includes: A data table file is formed according to the data in the first database, so that the user can perform business audit according to the data table file.

8. The method according to claim 1, characterized in that The obtaining of the plurality of first data items of the first file includes: Receive a file sent by an external system and obtain a first file; The first data is obtained from the first file one by one.

9. The method according to claim 8, characterized in that The receiving a file sent by the external system and obtaining the first file includes: A file sent by an external system is received and formatted to form a first file.

10. The method according to claim 9, characterized in that The receiving of a file sent by an external system and performing format conversion to form a first file includes: Receiving at least one file sent by an external system, wherein each of the files includes files sent in multiple batches and / or files sent by different external subsystems, and the external system includes at least two external subsystems; The files are merged and formatted to form a first file.

11. The method according to claim 1, characterized in that: The obtaining of the plurality of pieces of data from the second file includes: Acquire the file to be checked from the database as the second file; The second data is obtained from the second file one by one.

12. A data checking device, characterized in that: include: A first file data acquisition module, used to acquire multiple pieces of first data from a first file, and determine corresponding first key data for each piece of first data; A first file data storage module, used for storing each of the first data in the first file in a hash storage manner according to each of the first key data; A second file data acquisition module, used to acquire multiple pieces of second data from a second file, and determine corresponding second key data for each piece of second data, wherein the first key data is determined in the same manner as the second key data; A key data matching module, used for respectively searching for first data matching each of the second key data, wherein the first key data corresponding to the first data matches the second key data; A data checking module, used to compare the second data corresponding to each of the second key data with the matching first data, and determine a checking result between the first file and the second file; The first file data acquisition module is specifically used to: extract at least one transaction information from the first data, wherein the transaction information includes: user account, transaction type, transaction amount, transaction time, transaction identifier or associated system identifier; splice each of the transaction information to form first key data corresponding to the first data.

13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the data verification method as described in any one of claims 1-11 is implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data verification method as described in any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Data checking method and device and computer storage medium

    CN107392764A

  • A method and apparatus for identifying database differences

    CN109002472A

  • Data reconciliation method, device and equipment and storage medium

    CN110298740A

  • Data deduplication method, device, equipment and storage medium

    CN111258966A

  • Inline Wire Speed Deduplication System

    US20110307447A1